package com.fjl.shouquan;

import java.io.IOException;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

public class Base64Test
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		BASE64Encoder encoder = new BASE64Encoder();

		String usname = encoder.encode("Fjl".getBytes());
		
		System.out.println(usname);
		
		//解码
		BASE64Decoder decoder = new BASE64Decoder();
		
		try
		{
			
			String str = new String(decoder.decodeBuffer(usname));
			System.out.println(str);
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
